import request from '@/utils/request'

// 查询板栗树认领主列表
export function listModel(query) {
  return request({
    url: '/system/model/list',
    method: 'get',
    params: query
  })
}

// 查询板栗树认领主详细
export function getModel(treeId) {
  return request({
    url: '/system/model/' + treeId,
    method: 'get'
  })
}

// 新增板栗树认领主
export function addModel(data) {
  return request({
    url: '/system/model',
    method: 'post',
    data: data
  })
}

// 修改板栗树认领主
export function updateModel(data) {
  return request({
    url: '/system/model',
    method: 'put',
    data: data
  })
}

// 删除板栗树认领主
export function delModel(treeId) {
  return request({
    url: '/system/model/' + treeId,
    method: 'delete'
  })
}

export function historyList(query) {
  return request({
    url: '/system/history/list',
    method: 'get',
    params: query
  })
}

// 认养记录审核/结束认养
export function modelApprove(data) {
  return request({
    url: '/system/model/approve',
    method: 'post',
    data: data
  })
}
// 领养比例
export function calculatepercentage(query) {
  return request({
    url: '/system/model/calculatepercentage',
    method: 'get',
    params: query
  })
}
